package ro.peoplecentric.ctc.common.dao;

import java.util.List;
import ro.peoplecentric.ctc.common.entity.Item;
import ro.peoplecentric.ctc.common.exception.ApplicationException;
import ro.peoplecentric.ctc.common.util.ui.ItemCriteria;

/**
 * {@link  Item} DAO.
 *
 * @author pguzun
 */
public interface ItemDao extends BaseDao {

    /**
     * Get all {@link Item items}.
     *
     * @return list of all {@link Item items}.
     */
    List<Item> getAll();
    /**
     * Max number of last modified items
     */
    int MAX_LAST_MODIFIED_ITEMS = 5;

    /**
     * Get the {@link #MAX_LAST_MODIFIED_ITEMS n } last modified {@link Item items}.
     *
     * @return
     */
    List<Item> getLastModifiedItems();

    /**
     * Find {@link Item items} by ItemCriteria
     *
     * @param itemCriteria item criteria
     * @return list of found {@link Item items}.
     */
    List<Item> find(ItemCriteria itemCriteria);

    /**
     * Find all {@link Item items} sorted by column and sense
     *
     * @author Danut Chindris
     * @since October 11, 2013
     * @param order the sense used for sorting
     * @param orderBy the column used for sorting
     * @return list of found {@link Item items}
     */
    List<Item> getAllItems(String order, String orderBy)  throws ApplicationException;
}
